;(function(win) {
	var PhysicsEngine = function() {
		return new PhysicsEngine.init();
	}
	
	var physicsEngineProps = PhysicsEngine.prototype;
	PhysicsEngine.init = function() {};
	PhysicsEngine.init.prototype = physicsEngineProps;
	PhysicsEngine.version ={};
	PhysicsEngine.version.number = "1.0.0.RELEASE";
	PhysicsEngine.version.author = "yumi@omuao.com";
	physicsEngineProps.setWorldOptions = function(options) {
		this.worldOptions = options;
	}
			
	var Entity = function() {
		return new Entity.init();
	}
	var entityProps = Entity.prototype;
	//物理属性
	entityProps.physics = {};
	//化学属性
	entityProps.chemistry = {};

	//常量
	var physicsConstant = {
		state: {
			//固态
			CONST_PHYSICS_STATE_SOLID: 0,
			//液态
			CONST_PHYSICS_STATE_LIQUID: 1,
			//气态
			CONST_PHYSICS_STATE_GAS: 2
		}
	}
	entityProps.physics.constant = physicsConstant;
	//颜色
	entityProps.physics.color = null;
	//气味
	entityProps.physics.smell = null;
	//形态
	entityProps.physics.state = physicsConstant.state.CONST_PHYSICS_STATE_SOLID;
	//可融化
	entityProps.physics.meltable = false;
	//可凝固
	entityProps.physics.solidifyable = false;
	//可升华
	entityProps.physics.sublimable = false;
	//可挥发
	entityProps.physics.volatilizable = false;
	//熔点
	entityProps.physics.meltingPoint = null;
	//沸点
	entityProps.physics.boilingPoint = null;
	//硬度
	entityProps.physics.hardness = null;
	//导电系数
	entityProps.physics.conductivityForElectric = null;
	//导热系数
	entityProps.physics.conductivityForHeat = null;
	//延展系数
	entityProps.physics.elongationCoefficient = null;
	//溶解系数
	entityProps.physics.dissolutionCoefficient = null;
	//密度
	entityProps.physics.density = null;
	//挥发系数
	entityProps.physics.volatilizationCoefficient = null;
	//导电系数
	entityProps.physics.conductivityForElectric = null;
	//导热系数
	entityProps.physics.conductivityForHeat = null;
	//延展系数
	entityProps.physics.elongationCoefficient = null;
	//磁力系数
	entityProps.physics.magneticCoefficient = null;

	Entity.init = function() {};
	Entity.init.prototype = entityProps;
	
	win.PhysicsEngine = PhysicsEngine;
	
	//初始化物理引擎
	if(win.JadeEngine != null && typeof win.JadeEngine !== "undefined" ){
		JadeEngine.World.prototype.setPhysicsEngine = function(physicsEngine){
			if(!physicsEngine instanceof PhysicsEngine){
				throw "PhysicsEngine is not set";
			}
			physicsEngine.setWordOptions(this);
			this.physicsEngine = physicsEngine;
			return this.physicsEngine;
		}
		JadeEngine.World.prototype.getPhysicsEngine = function(){
			if(this.physicsEngine == null || typeof this.physicsEngine === "undefined") {
				this.physicsEngine = new PhysicsEngine();
				this.physicsEngine.setWorldOptions(this);
			}
			return this.physicsEngine;
		}
		JadeEngine.World.prototype.getPhysicsEngineVersionInfo = function(){
			return PhysicsEngine.version;
		}
	}
}(window));